<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="renderer" content="webkit" />
    <meta
      name="viewport"
      content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0"
    />
    <title>pure-admin-thin</title>
    <link rel="icon" href="/favicon.ico" />
    <script type="text/javascript">
      window._AMapSecurityConfig = {
        securityJsCode: '26eb7908cf6575ad3c87c2db5d48cb3a',
      }
    </script>
    <script type="text/javascript" src="https://webapi.amap.com/maps?v=2.0&key=d55984270e5137924f92ab1595b92a30&plugin=AMap.PlaceSearch,AMap.Geocoder,AMap.AutoComplete"></script>

  </head>

  <body>
    <div id="app">
      <style>
        html,
        body,
        #app {
          position: relative;
          display: flex;
          align-items: center;
          justify-content: center;
          width: 100%;
          height: 100%;
          overflow: hidden;
        }

        .loader,
        .loader::before,
        .loader::after {
          width: 2.5em;
          height: 2.5em;
          border-radius: 50%;
          animation: load-animation 1.8s infinite ease-in-out;
          animation-fill-mode: both;
        }

        .loader {
          position: relative;
          top: 0;
          margin: 80px auto;
          font-size: 10px;
          color: #406eeb;
          text-indent: -9999em;
          transform: translateZ(0);
          transform: translate(-50%, 0);
          animation-delay: -0.16s;
        }

        .loader::before,
        .loader::after {
          position: absolute;
          top: 0;
          content: "";
        }

        .loader::before {
          left: -3.5em;
          animation-delay: -0.32s;
        }

        .loader::after {
          left: 3.5em;
        }

        @keyframes load-animation {
          0%,
          80%,
          100% {
            box-shadow: 0 2.5em 0 -1.3em;
          }

          40% {
            box-shadow: 0 2.5em 0 0;
          }
        }
      </style>
      <div class="loader"></div>
    </div>
    <script type="module" src="/src/main.ts"></script>
    <script>
      function fetchMapSuggestions(queryString, cb) {
        if (!autoComplete) {
          cb([]);
          return;
        }
        autoComplete.search(queryString, function (status, result) {
          if (status === "complete" && result.tips) {
            const suggestions = result.tips
              .filter((tip) => tip.location)
              .map((tip) => {
                // 转换成 el-autocomplete 需要的格式
                return {
                  ...tip, // 保留原始数据，便于 @select 时使用
                  value: tip.name // el-autocomplete 用 value 字段显示
                };
              });
            cb(suggestions);
          } else {
            cb([]);
          }
        });
      }
    </script>
  </body>
</html>
